/**
 * 
 */
package org.swingannotations;

import java.awt.Container;

import org.swingannotations.impl.AnnotationProcessor;

/**
 * A document loader that will create the given GUI, and process any 
 * Swing Annotations against any given controllers.
 * @author jduty
 *
 */
public class DocumentLoader {

	
	/**
	 * Given a controller and the view class, we will create an instance of the view 
	 * and process any annotations present in the controller.
	 * @param controller
	 * @param viewClass
	 */
	public static void loadView(Object controller, Class<? extends Container> viewClass) throws Exception
	{
		AnnotationProcessor processor = new AnnotationProcessor();
		processor.addController(controller);
		processor.addViewClass(viewClass);
		processor.process();
	}
	
	
}
